$(".project_del_btn").click(function(){
    var project_id = $(this).attr("data-project-id");
    var project_del_btn = $(this);
    swal({
        title: '你确定删除这个项目吗？',
        type: 'warning',
        showConfirmButton: true,
        showCancelButton: true,
        confirmButtonText: '确定',
        cancelButtonText: '取消'
    }).then(function(isConfirm){
        if(isConfirm.value){
            //console.log(isConfirm.value);
            //swal('你点了确认按钮');
            $.ajax("test.php",{//在此处替换提交数据的地址
                type:"POST",
                data: {project_id:project_id, operation_events:"del"},
                success:function (data) {
                    swal({
                        title: '删除成功',
                        type: 'success',
                        timer: '1200',
                        showConfirmButton: false,
                        showCancelButton: false
                    });
                    project_del_btn.parent().parent().remove();
                },
                error:function (textStatus) {
                    swal({
                        title: '删除失败',
                        text: '删除操作未能发送，请稍后再试！',
                        type: 'error',
                        confirmButtonText: '知道了',
                        showConfirmButton: true,
                        confirmButtonColor: '#f4516c'
                    })
                }

            });
        }else{
            swal({
                title: '取消删除',
                type: 'error',
                timer: '1200',
                showConfirmButton: false,
                showCancelButton: false
            });
        }
    })
})